<?php
namespace app\mini\model;

use think\Model;
use traits\model\SoftDelete;

class DataUser extends Model
{

    protected $autoWriteTimestamp = true;

    use SoftDelete;

    protected $deleteTime = 'delete_time';

    /*
     * 查询用户信息
     * @param $where where
     * @param $field field
     * @author cpy(1442435897@qq.com)
     */
    public function getUserInfo($where,$field = '*') {
        $res = $this->field($field)->where($where)->find();
        return empty($res)?array():$res->toArray();
    }

    /*
     * 查询所有信息
     * @param $where where
     * @param $field field
     * @author cpy(1442435897@qq.com)
     */
    public function selectInfo($where,$limit,$field = '*') {
        $res = $this->field($field)->where($where)->limit($limit)->order('id desc')->select();
        return empty($res)?array():$res->toArray();
    }


}